{% extends "base.html" %}

{% block content %}

There`s <span id="selected_photo_count">0</span> photos selected.

<button onclick="json_test()">Dill</button>
<button onclick="clear_selected_photos()">Clear selection</button>
<P/>
<table>
    <tr>
        <td>

{% for photo in photos.object_list %}
    <img id="photo_ref_{{ photo.id }}" class="unselected" src="{{ photo.thumbnail_url }}" onclick="register({{ photo.id }})" id="photo_{{ photo.id }}"></img>
    <br/>{{ photo.title }}
    <div id="photo_msg_{{ photo.id }}">SELECTED!</div>

    <div id="star1" class="rating">&nbsp;</div>
{% endfor %}

</td>
<td>
    <div id="list_selected_photos">&nbsp;</div>
</td>
</tr>
</table>

<div class="demo">
<ul class="gallery_demo_unstyled">
{% for photo in photos.object_list %}
    <li><img id="photo_ref_{{ photo.id }}" alt="{{ photo.title }}" title="{{ photo.title }}" class="unselected" src="{{ photo.thumbnail_url }}" onclick="register({{ photo.id }})" id="photo_{{ photo.id }}"></li>
{% endfor %}
</ul>
<p class="nav"><a href="#" onclick="$.galleria.prev(); return false;">previous</a> | <a href="#" onclick="$.galleria.next(); return false;">next</a></p>
</div>


<div class="pagination">
    <span class="step-links">
        {% if photos.has_previous %}
            <a href="?page={{ photos.previous_page_number }}">previous</a>
        {% endif %}

        <span class="current">
            Page {{ photos.number }} of {{ photos.paginator.num_pages }}.
        </span>

        {% if photos.has_next %}
            <a href="?page={{ photos.next_page_number }}">next</a>
        {% endif %}
    </span>
</div>

{% endblock %}